(function(){
	'use strict';

	var app = angular.module('zhxLd',['zhxLoadingModule']);

	app.controller('zhxLdCtrl', ['$scope','zhxLoadingService','$timeout',function($scope,zhxLoadingService,$timeout){
		
		//Add Loading to Body
		$scope.showBodyLoading = function(status){

			var loading = zhxLoadingService.createLoading({
				animate : status
			});

			$timeout(function(){
				loading.close();
			},2000);

		};

		//Add loading to div
		$scope.showTargetLoading = function(target,text){
			var loading = zhxLoadingService.createLoading({
				target : target,
				text : text || null
			});

			$timeout(function(){
				loading.close();
			},2000)

		}

	}]);

})()